<script>
    import Counter from './lib/Counter.svelte'   // 导入自己的组件
    import Markmap from './composeition/markmap.svelte' // 导入自己的组件
    let name = '你好'    // 设置变量
    let isVip = true
    let age = 20

    function ch_vip() {
        isVip = !isVip
        return isVip
    }



</script>

<main>

    <Markmap title="生成思维导图"></Markmap>
    <Counter/>
    <button on:click={ch_vip}> 切换</button>
    <div>{name}</div>

    {#if isVip}
        <h1>你是vip</h1>
    {:else}
        <h1>你不是vip</h1>
    {/if}

    {#if age < 18}
        <h1>你是儿童</h1>
    {:else if age > 18 && age < 60}
        <h1>你是年轻人</h1>
    {:else }
        <h1>你是老人</h1>
    {/if}

    {#each [1, 2, 3] as item}
        <h1>{item}</h1>
    {/each}


</main>

<style>

</style>
